<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单详情</title>
<script type="text/javascript">
	function changePage(method) {
		var pageNo = document.forms[0].pageNo.value;
		var total = document.forms[0].total.value;
		if (method == "next") {
			if (parseInt(pageNo) >= parseInt(total)) {
				alert("当前已经是最后一页！");
				return false;
			} else {
				document.forms[0].pageNo.value = parseInt(pageNo) + 1;
			}
		}
		if (method == "previous") {
			if (parseInt(pageNo) <= 1) {
				alert("当前已经是第一页");
				return false;
			} else {
				document.forms[0].pageNo.value = parseInt(pageNo) - 1;
			}
		}
		if (method == "first") {
			document.forms[0].pageNo.value = 1;
		}
		if (method == "end") {
			document.forms[0].pageNo.value = total;
		}

		document.forms[0].submit();
	}
</script>
</head>
<body>

			<form action="<c:url value='/OrderAction?oper=list'/>" method="post">
					<input type="hidden" name="pageNo" value="${pageNo}"> 
					<input type="hidden" name="total" value="${total}"> 
					<c:forEach items="${orderDetiallist }" var="OrderDetial">
					<input type="hidden" name="oid" value="${OrderDetial.orderID }">
					</c:forEach>
			</form>
					
					
			
<table class="table table-hover">
   <thead>
      <tr>
        	<th>订单编号</th>
			<th>名称</th>
			<th>价格</th>
			<th>数量</th>
			<th>尺寸</th>
			<th>颜色</th>
      </tr>
   </thead>
   <tbody>
   <c:forEach items="${orderDetiallist }" var="OrderDetial">
			<tr>
				<td>${OrderDetial.orderID }</td>
				<td>${OrderDetial.clothing.name }</td>
				<td>${OrderDetial.price }</td>
				<td>${OrderDetial.amount }</td>
				<td>${OrderDetial.clothing.size}</td>
				<td>${OrderDetial.clothing.color}</td>
			</tr>
		</c:forEach>
  
   </tbody>
</table>		

			<div class="text-center">
			查询到：${count}条记录
			<a href="#" onclick="changePage('first')">首页</a> 
			<a href="#" onclick="changePage('previous')">上一页</a> 
			<a href="#" onclick="changePage('next')">下一页</a>
			 第${ pageNo}页/共${total}页
			<a href="#" onclick="changePage('end')">尾页</a>
			</div>

<a href = "<c:url value='/UserInfoAction?oper=myOrder'/>">返回上一页</a>
</body>
</html>